package org.msfj.common.util;
import java.io.File;
import java.io.FileOutputStream;
/**
 * @Description:
 * @Author: like
 * @Date: 2018-08-10 18:41
 * @Version: 1.0
 * @Created in idea by autoCode
 */
public class FileUtil {
    //文件上传工具类服务方法
    public static void uploadFile(byte[] file, String filePath, String fileName) throws Exception{
        File targetFile = new File(filePath);
        if(!targetFile.exists()){
            targetFile.mkdirs();
        }
        FileOutputStream out = new FileOutputStream(filePath+fileName);
        out.write(file);
        out.flush();
        out.close();
    }
}
